AdfUIComponents.createComponentClass("AdfRichInputText", { componentType:"oracle.adf.RichInputText", propertyKeys:[{name:"changed",type:"Boolean","default":false} ,{name:"changedDesc",type:"String"} ,{name:"autoSubmit",type:"Boolean","default":false} ,{name:"accessKey",type:"String"} ,{name:"contentStyle",type:"String"} ,{name:"helpTopicId",type:"String"} ,{name:"disabled",type:"Boolean","default":false,secured:true} ,{name:"label",type:"String"} ,{name:"readOnly",type:"Boolean","default":false,secured:true} ,{name:"showRequired",type:"Boolean","default":false} ,{name:"simple",type:"Boolean","default":false} ,{name:"shortDesc",type:"String"} ,{name:"unsecure",type:"Object",secured:true} ,{name:"visible",type:"Boolean","default":true} ,{name:"editable",type:"String","default":"inherit"} ,{name:"autoTab",type:"Boolean","default":false} ,{name:"columns",type:"Number"} ,{name:"dimensionsFrom",type:"String","default":"content"} ,{name:"inlineStyle",type:"String"} ,{name:"maximumLength",type:"Number"} ,{name:"rows",type:"Number","default":1} ,{name:"secret",type:"Boolean","default":false,secured:true} ,{name:"styleClass",type:"String"} ,{name:"wrap",type:"String"} ], superclass:AdfUIInput }); AdfRichUIPeer.createPeerClass(AdfDhtmlInputBasePeer,"AdfDhtmlInputTextPeer"); AdfDhtmlInputTextPeer.InitSubclass= function() { AdfObject.ensureClassInitialization(AdfRichInputText); AdfRichUIPeer.addComponentPropertyGetters(this, AdfRichInputText.LABEL); AdfRichUIPeer.addComponentEventHandlers(this, AdfUIInputEvent.KEY_PRESS_EVENT_TYPE, AdfUIInputEvent.KEY_UP_EVENT_TYPE); AdfRichUIPeer.addComponentPropertyChanges(this,AdfRichInputText.LABEL); } AdfDhtmlInputTextPeer.prototype.replaceTextSelection= function(x0) { var x1=this.getComponent(); if (this.WasSubmitted(x1)) { var x2=AdfDhtmlEditableValuePeer.GetContentNode(x1); AdfEditingAgent.getInstance().insertHtmlAtSelection(x2,x0); this.RunValidation(x1,x2); } } AdfDhtmlInputTextPeer.prototype.needsResizeNotify= function(x3) { var x4=AdfAgent.AGENT; var x5=x4.getPlatform()==AdfAgent.IE_PLATFORM; var x6=x4.getVersion(); return (x5&&x6<8&&AdfDomUtils.containsCSSClassName(AdfRichUIPeer.getDomNodeForComponent(x3),"p_AFStretched")); } AdfDhtmlInputTextPeer.prototype.resizeNotify= function( x7, x8, x9, x10, x11 ) { var x12=AdfAgent.AGENT; var x13=AdfDhtmlEditableValuePeer.GetContentNode(x7); x12.setOuterWidth(x13,x10); x12.setOuterHeight(x13,x11); } AdfDhtmlInputTextPeer.prototype.SetDisplayValue= function( x14, x15, x16) { AdfAssert.assertString(x16); var x17=AdfDhtmlEditableValuePeer.GetContentNode(x14); if (x14.getReadOnly()) { if ((x14.getRows()>1)||(this.IsSecret(x14)!=true)) { AdfAgent.AGENT.setTextContent(x17,x16); } } else { if (!this.IsSecret(x14)) x17.title=x16; x17.value=x16; } } AdfDhtmlInputTextPeer.prototype.IsSecret= function( x18 ) { var x19=AdfDhtmlEditableValuePeer.GetContentNode(x18); if(x19.type=="password") { return true; } else { return false; } } AdfDhtmlInputTextPeer.prototype.HandleComponentKeyPress= function(x20) { if(x20.getEventPhase()==AdfBaseEvent.AT_TARGET_PHASE) { var x21=this.getComponent(); var x22=x20.getNativeEventTarget(); var x23=x20.getNativeEvent(); var x24=AdfAgent.AGENT.getKeyCode(x23); if (x22.tagName=="TEXTAREA") { if (this._checkLength(x21,x22)) { var x25=x23.keyCode; var x26=x23.charCode; if (x25==0||x25==13||x26==undefined||x25==x26){ if (!x23.ctrlKey){ var x27=true; if (x22.selectionStart!=null) { x27=(x22.selectionStart==x22.selectionEnd); } else if (document.selection) { var x28=document.selection.createRange(); x27=(x28.text==""); } if (x27) x20.cancel(); } } } } else { if (x24==AdfKeyStroke.ENTER_KEY) { this.RunValidation(x21,x22); } } this._nodeLength=(x22.value)?x22.value.length:0; } } AdfDhtmlInputTextPeer.prototype.HandleComponentKeyUp= function(x29) { if(x29.getEventPhase()==AdfBaseEvent.AT_TARGET_PHASE) { var x30=AdfAgent.AGENT.getKeyCode(x29.getNativeEvent()); if (x30!=9) this.AutoTab(this.getComponent(),x29.getNativeEventTarget()); delete this._nodeLength; var x31=this.getComponent(); var x32=x29.getNativeEventTarget(); this._checkLength(x31,x32); } } AdfDhtmlInputTextPeer.prototype.AutoTab= function( x33, x34) { if(x33.getAutoTab&&x33.getAutoTab()) { var x35=x33.getMaximumLength(); if (x35<1) return; var x36=(x34.value)?x34.value.length:0; if (x36>=x35&&x36>this._nodeLength) { AdfFocusUtils.focusNextTabStop(x34); } } } AdfDhtmlInputTextPeer.prototype.GetInlineEditor= function(x37) { return AdfDhtmlSimpleLabelEditor.getInlineEditor(); } AdfDhtmlInputTextPeer.prototype._checkLength= function( x38, x39) { if (x38&&x38.getMaximumLength) { var x40=x38.getMaximumLength(); if (x40<1) return false; var x41=(x39.value)?x39.value.length:0; if (x41>=x40) { if (x41>x40) x39.value=x39.value.substr(0,x40); return true; } } return false; } function AdfInsertTextBehavior(x0,x1,x2) { this.Init(x0,x1,x2); } AdfInsertTextBehavior.InitClass= function() { } AdfObject.createSubclass(AdfInsertTextBehavior,AdfClientBehavior); AdfInsertTextBehavior.prototype.Init= function(x0,x1,x2) { AdfInsertTextBehavior.superclass.Init.call(this); AdfAssert.assertString(x0); this._componentId=x0; this._value=x1; this._triggerType=x2; } AdfInsertTextBehavior.prototype.initialize= function(x3) { var x4=this._triggerType; if (!x4) x4=AdfActionEvent.ACTION_EVENT_TYPE x3.addEventListener(x4,this.fire,this); } AdfInsertTextBehavior.prototype.fire= function(x5) { x5.cancel(); var x6=x5.getSource(); var x7=this._componentId; var x8=x6.findComponent(x7); var x9=AdfLogger.LOGGER; if (!x8) { x9.severe("Could not find component with Id: " + x7); return; } var x10=x8.getPeer(); x10.bind(x8); if (x10.replaceTextSelection) x10.replaceTextSelection(this._value); } function AdfEditingAgent() { this.Init(); } AdfObject.createSubclass(AdfEditingAgent); AdfEditingAgent.getInstance= function() { if (AdfEditingAgent._instance==undefined) { var x0=AdfAgent.AGENT.getPlatform(); switch(x0) { case AdfAgent.GECKO_PLATFORM: AdfEditingAgent._instance= new AdfGeckoEditingAgent(); break; case AdfAgent.IE_PLATFORM: AdfEditingAgent._instance= new AdfIEEditingAgent(); break; case AdfAgent.WEBKIT_PLATFORM: AdfEditingAgent._instance= new AdfSafariEditingAgent(); break; default: AdfLogger.LOGGER.severe("Rich Text Editing is not supported on this platform"); break; } } return AdfEditingAgent._instance; } AdfEditingAgent.prototype.toBrowserSpecificCommand= function(x1) { return x1; } AdfEditingAgent.prototype.getContentWindow= function(x2) { AdfAssert.assertDomElement(x2,"IFRAME"); AdfAssert.assert(x2.contentWindow,"Unexpected null contentWindow."); return x2.contentWindow; } AdfEditingAgent.prototype.getInlineFrameDocument= function(x3) { AdfAssert.assertDomElement(x3,"IFRAME"); var x4=this.getContentWindow(x3); AdfAssert.assert(x4,"Unexpected null contentWindow."); AdfAssert.assert(x4.document,"Unexpected null contentWindow document."); return x4.document; } AdfEditingAgent.prototype.execCommand= function( x5, x6, x7, x8 ) { var x9; if (x7!="insert") { AdfAssert.assertDomElement(x6,"IFRAME"); x9=AdfEditingAgent.getInstance().getInlineFrameDocument(x6); } if (x8==null) { switch(x7) { case "createlink": var x10=AdfPage.PAGE.getLookAndFeel(); var x11=x10.getTranslatedString("af_richTextEditor.LABEL_SPECIFY_THE_URL"); var x12=this._getLinkURLForSelection(x5,x6); x8=prompt(x11,x12); if ((x8==null)||(x8=="")) { return; } break; } } switch(x7) { case "insert": var x13=x8; if (x13==null) { x13=""; } this.insertHtmlAtSelection(x6,x13); break; case "moderichtext": x5.getPeer().setCodeEditingMode(false); break; case "modecode": x5.getPeer().setCodeEditingMode(true); break; case "undo": this.ExecuteUndo(x5,x6,x9); break; case "redo": this.ExecuteRedo(x5,x6,x9); break; case "createlink": this.CreateLink(x5,x9,x8); break; default: this._executeCommand(x5,x9,x7,x8); } } AdfEditingAgent.prototype.queryCommandEnabled= function(x14,x15,x16) { AdfAssert.assertString(x16); var x17=false; switch(x16) { case "insert": case "moderichtext": case "modecode": x17=true;break; case "undo": x17=this.QueryUndoEnabled(x14,x15); break; case "redo": x17=this.QueryRedoEnabled(x14,x15); break; default: x17=this._queryCommandEnabled(x14,x15,x16); } return x17; } AdfEditingAgent.prototype.setInlineFrameContentEditable= function(x18) { AdfAssert.assertDomElement(x18,"IFRAME"); var x19=this.getInlineFrameDocument(x18); x19.designMode="on"; return true; } AdfEditingAgent.prototype.isDesignMode= function(x20) { var x21=this.getInlineFrameDocument(x20); var x22=x21.designMode; if (x22) x22=x22.toLowerCase(); return x22=="on"; } AdfEditingAgent.prototype.isDesignModeReloadingFrame= function() { return false; } AdfEditingAgent.prototype.queryCommandValue= function(x23,x24) { x24=this.toBrowserSpecificCommand(x24); var x25=false; try { x25=this.getInlineFrameDocument(x23).queryCommandValue(x24); } catch(e) { AdfLogger.LOGGER.severe("queryCommandValue: command not supported (",x24,").",e); } return x25; } AdfEditingAgent.prototype.queryCommandState= function(x26,x27) { AdfAssert.assertString(x27); if (x27=="indent"||x27=="outdent") { return; } if ( x27=="forecolor"|| x27=="backcolor"|| x27=="fontsize"|| x27=="fontname" ) { return this.queryCommandValue(x26,x27); } var x28=false; x27=this.toBrowserSpecificCommand(x27); try { x28=this.getInlineFrameDocument(x26).queryCommandState(x27); } catch(e) { AdfLogger.LOGGER.severe("queryCommandState: command not supported (",x27,").",e); } return x28; } AdfEditingAgent.prototype.setRTL= function(x29) { AdfAssert.assert(x29); var x30=x29.body; AdfAssert.assertDomElement(x30,"BODY"); x30.setAttribute("dir",AdfPage.PAGE.getLocaleContext().isRightToLeft()?"rtl":"ltr"); } AdfEditingAgent.prototype.queryCommandIndeterminate= function(x31,x32) { x32=this.toBrowserSpecificCommand(x32); var x33=false; try { x33=this.getInlineFrameDocument(x31).queryCommandIndeterm(x32); } catch(e) { AdfLogger.LOGGER.severe("queryCommandIndeterminate: command not supported (",x32,").",e); } return x33; } AdfEditingAgent.prototype.getFocusBlurElement= function(x34) { return x34; } AdfEditingAgent.prototype.getSelectionRange= function(x35) { return this.getInlineFrameDocument(x35).selection.createRange(); } AdfEditingAgent.prototype.getInlineFrameContent= function(x36,x37) { return this.getInlineFrameDocument(x36).body.innerHTML; } AdfEditingAgent.prototype.setInlineFrameContent= function(x38,x39) { this.getInlineFrameDocument(x38).body.innerHTML=x39; } AdfEditingAgent.prototype.getDefaultContent= function() { return ""; } AdfEditingAgent.prototype.setSelectionRange= function(x40,x41) { x41.select(); } AdfEditingAgent.prototype.insertHtmlAtSelection= function(x42,x43) { if (x42.nodeName=="TEXTAREA"||x42.nodeName=="INPUT") { var x44=x42.selectionStart+x43.length; x42.value=x42.value.substr(0,x42.selectionStart) + x43 + x42.value.substr(x42.selectionEnd); x42.selectionStart=x44; x42.selectionEnd=x44; } else { var x45=this.getSelectionRange(x42); if (x45==null) { AdfLogger.LOGGER.severe("Unexpected null selection for insert command."); } else { if (x45.toString().length>0) { x45.deleteContents(); } var x46=x45.cloneRange(); var x47=document.createElement("div"); x47.innerHTML=x43; var x48=x47.childNodes; var x49=x48.length; var x50=null; for(var x51=x49-1;x51>=0;x51--) { var x52=x48[x51]; if (x50==null) { x50=x52; } x45.insertNode(x52); } if (x50!=null) { x45.selectNode(x50); x45.setStartAfter(x50); } } } } AdfEditingAgent.prototype.handleTab= function(x53,x54) { } AdfEditingAgent.prototype.updateValueHistory= function(x55,x56,x57) { } AdfEditingAgent.prototype.ExecuteUndo= function(x58,x59,x60) { this._executeCommand(x58,x60,"undo",null); } AdfEditingAgent.prototype.ExecuteRedo= function(x61,x62,x63) { this._executeCommand(x61,x63,"redo",null); } AdfEditingAgent.prototype.CreateLink= function (x64,x65,x66) { this._executeCommand(x64,x65,"createlink",x66); } AdfEditingAgent.prototype.QueryUndoEnabled= function(x67,x68) { return this._queryCommandEnabled(x67,x68,"undo"); } AdfEditingAgent.prototype.QueryRedoEnabled= function(x69,x70) { return this._queryCommandEnabled(x69,x70,"redo"); } AdfEditingAgent.prototype.IsNodeWrappingRange= function(x71,x72) { var x73=x72.ownerDocument.createRange(); try { x73.selectNode(x72); } catch(e) { AdfLogger.LOGGER.logErrorAsInfo(e,"Unable to select node in range"); return false; } var x74= (x71.compareBoundaryPoints(Range.START_TO_START,x73)!= -1); var x75= (x71.compareBoundaryPoints(Range.END_TO_END,x73)!=1); return (x74&&x75); } AdfEditingAgent.prototype._executeCommand= function(x76,x77,x78,x79) { var x80=this.toBrowserSpecificCommand(x78); try { x77.execCommand(x80,null,x79); } catch(e) { AdfLogger.LOGGER.severe( "execCommand[",x78,",",x79,"] failed with the following exception: ",e); } } AdfEditingAgent.prototype._queryCommandEnabled= function(x81,x82,x83) { var x84=false; var x85=this.getInlineFrameDocument(x82); x83=this.toBrowserSpecificCommand(x83); try { x84=x85.queryCommandEnabled(x83); } catch(e) { AdfLogger.LOGGER.severe( "queryCommandEnabled failed with the following exception: [", x83, "]: ", e ); } return x84; } AdfEditingAgent.prototype._getLinkURLForSelection= function(x86,x87) { AdfAssert.assertDomElement(x87,"IFRAME"); var x88=this.getInlineFrameDocument(x87); var x89=x88.getElementsByTagName("a"); var x90=x86.getPeer().getSelectionRange(x86); var x91="about:blank"; for(var x92=0;x92

"; } AdfSafariEditingAgent.prototype.insertHtmlAtSelection= function(x5,x6) { if (x5.nodeName=="TEXTAREA"||x5.nodeName=="INPUT") { var x7=x5.selectionStart+x6.length; x5.value= x5.value.substr(0,x5.selectionStart) + x6 + x5.value.substr(x5.selectionEnd); x5.selectionStart=x7; x5.selectionEnd=x7; } else { var x8=this.getSelectionRange(x5); if (x8==null) { var x9=this.getInlineFrameDocument(x5); var x10=x9.createElement("div"); x10.innerHTML=x6; var x11=x10.childNodes; var x12=x11.length; var x13=x9.body; for(var x14=x12-1;x14>=0;x14--) { var x15=x11[x14]; x13.insertBefore(x15,x13.firstChild); } } else { if (x8.toString().length>0) { x8.deleteContents(); } var x9=this.getInlineFrameDocument(x5); var x10=x9.createElement("div"); x10.innerHTML=x6; var x11=x10.childNodes; var x12=x11.length; var x16=null; for(var x14=x12-1;x14>=0;x14--) { var x15=x11[x14]; if (x16==null) { x16=x15; } x8.insertNode(x15); } if (x16!=null) { x8.selectNode(x16); x8.setStartAfter(x16); } } } } AdfSafariEditingAgent.prototype.toBrowserSpecificCommand= function(x17) { var x18=x17; if (x17==AdfSafariEditingAgent._cmdBackColor) { x18=AdfSafariEditingAgent._cmdHiliteColor; } return x18; } AdfSafariEditingAgent.prototype.setInlineFrameContentEditable= function(x19) { if (this.isDesignMode(x19)) return false; var x20=AdfSafariEditingAgent.superclass.setInlineFrameContentEditable.call(this,x19); if (this.isDesignMode(x19)) { this.execCommand(null,x19,"styleWithCSS",true); } return x20; } AdfSafariEditingAgent.prototype.getFocusBlurElement= function(x21) { AdfAssert.assertDomElement(x21,"IFRAME"); var x22=this.getInlineFrameDocument(x21).body; x22.tabIndex=0; return x22; } AdfSafariEditingAgent.prototype.getSelectionRange= function(x23) { AdfAssert.assertDomElement(x23,"IFRAME"); var x24=this._getWindowSelection(x23); if (x24&&(x24.rangeCount>0)) { return x24.getRangeAt(0); } } AdfSafariEditingAgent.prototype.setSelectionRange= function(x25,x26) { AdfAssert.assertDomElement(x25,"IFRAME"); var x27=this._getWindowSelection(x25); if (x27) { x27.removeAllRanges(); x27.addRange(x26); } } AdfSafariEditingAgent.prototype._getWindowSelection= function(x28) { AdfAssert.assertDomElement(x28,"IFRAME"); return this.getInlineFrameDocument(x28).defaultView.getSelection(); } AdfSafariEditingAgent.prototype.handleTab= function(x29,x30) { if (x30.shiftKey) { AdfAgent.AGENT.preventDefault(x30); AdfFocusUtils.focusPreviousTabStop(x29); } else { AdfAgent.AGENT.preventDefault(x30); AdfFocusUtils.focusNextTabStop(x29,null,true); } } AdfSafariEditingAgent.prototype.queryCommandValue= function(x31,x32) { if (!this.isDesignMode(x31)) { return; } return AdfSafariEditingAgent.superclass.queryCommandValue.call(this,x31,x32); } AdfSafariEditingAgent.prototype.queryCommandState= function(x33,x34) { if (!this.isDesignMode(x33)) { return; } return AdfSafariEditingAgent.superclass.queryCommandState.call(this,x33,x34); } AdfSafariEditingAgent.prototype.queryCommandIndeterminate= function(x35,x36) { if (!this.isDesignMode(x35)) { return false; } return AdfSafariEditingAgent.superclass.queryCommandIndeterminate.call(this,x35,x36); } AdfSafariEditingAgent.prototype.queryCommandEnabled= function(x37,x38,x39) { if (!this.isDesignMode(x38)) { return false; } return AdfSafariEditingAgent.superclass.queryCommandEnabled.call( this, x37, x38, x39); }